<!DOCTYPE html>
<html lang="zh"
      xmlns="http://www.w3.org/1999/xhtml" xmlns:th="https://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" i="ieice5fesjlsfepjpwefmadf">
    <title>register</title>
    <link rel="stylesheet" href="/static/assets/css/bootstrap.min.css" th:href="@{/assets/css/bootstrap.min.css}" />
    <link rel="stylesheet" href="/static/assets/css/signin.css" th:href="@{/assets/css/signin.css}" />
    <script src="/static/assets/js/jquery.min.js" th:src="@{/assets/js/jquery.min.js}"></script>
</head>
<body>
<div class="container">
    <form class="form-signin" method="post" >
        <h2 class="form-signin-heading">欢迎注册</h2>
        <div th:if="${!#strings.isEmpty(error)}" class="alert alert-danger" role="alert">
            <span th:text="${error}" ></span>
        </div>
        <input type="hidden" name="_csrf" th:value="${_csrf?.token}"> <br>
        <p>
            <label for="username" class="sr-only">昵称</label>
            <input type="text" id="username" name="nickname" class="form-control username" placeholder="昵称" required>
        </p>
        <p class="email_field">
            <label for="email" class="sr-only">邮箱</label>
            <input type="email" id="email" name="email" class="form-control " placeholder="邮箱">
        </p>
        <p>
            <label for="password" class="sr-only">密码</label>
            <input type="password" id="password" name="password" class="form-control password" placeholder="密码" required>
        </p>


        <button class="btn btn-lg btn-primary btn-block submit mt-5" type="submit">注册</button>
        <a class="btn btn-light btn-block bg-white" href="/login" role="link" style="text-transform: none;">
            登录
        </a>
    </form>
</div>
<script >
    $(document).ready(function(){
        // $('.email_field').hide();

        $('#code-c').click(function () {
            $('.email_field').show();
            $('.code_field').hide();
        });

        $('#mail-c').click(function () {
            $('.code_field').show();
            $('.email_field').hide();

        });
    });
</script>
</body>
</html>
